/*
	Library for SPI/UART communication on ATmega328p
	(as master for SPI)

	Pin assignments:
	----------------
	UART TX		PD1
	UART RX		PD0

	SPI SCK		PB5
	SPI MISO	PB4
	SPI MOSI	PB3
	SPI SS		PB2
*/

#include <avr/io.h>

#ifndef F_CPU
#define F_CPU 20000000
#endif

#ifndef _COMMUNICATION_H_
#define _COMMUNICATION_H_

//SPI
void spi_master_init(void);
void spi_off(void);
uint8_t spi_tx(uint8_t);
void ss_hi(void);
void ss_lo(void);

//UART
void uart_9600(void);
void uart_tx(uint8_t);
uint8_t uart_rx(void);

#endif
